<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<!DOCTYPE HTML>
<html>
	<head>
		<title>菜单更新 - 用户中心</title>
		<%@ include file="/common/include/title.jsp"%>
		<link
			href="${rootPath }/common/resource/H-ui.admin/static/h-ui.admin/css/H-ui.login.css"
			rel="stylesheet" type="text/css" />
		<meta name="keywords" content="用户中心-登录">
		<meta name="description" content="用户中心-登录">
		</head>
	<body>
		<nav class="breadcrumb">
			<i class="Hui-iconfont">&#xe67f;</i> 首页
			<span class="c-gray en">&gt;</span>权限模块 
			<span class="c-gray en">&gt;</span> 菜单更新
			<a class="btn btn-success radius r" style="line-height: 1.6em; margin-top: 3px"
				href="javascript:location.replace(location.href);" title="刷新">
				<i class="Hui-iconfont">&#xe68f;</i>
			</a>
		</nav>
		<article class="page-container">
			<form class="form form-horizontal" id="form-article-add" 
				action="${rootPath }/back/UsersBack/menuUpdateSubmit">
				<input type="hidden" name="id" value="${requestScope.menu.id }">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">
					<span class="c-red">*</span>上一级：</label>
					<div class="formControls col-xs-8 col-sm-9">
						${requestScope.menu.parentMenu.name }
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">
					<span class="c-red">*</span>名称：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="${requestScope.menu.name }" placeholder=""
							id="name" name="name">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">
					<span class="c-red">*</span>Url：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="${requestScope.menu.url }" placeholder=""
							id="url" name="url">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">
					<span class="c-red">*</span>发布时间：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" readonly="readonly" value="<fmt:formatDate value="${requestScope.menu.pubTime }" pattern="yyyy-MM-dd HH:mm:ss"/>"
							onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
							name="pubTime" class="input-text Wdate">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">
						状态：
					</label>
					<div class="formControls col-xs-8 col-sm-9 skin-minimal">
						<div class="radio-box">
							<label>
								<input name="status" type="radio" id="status0" value="0" ${requestScope.menu.status == '0' ? 'checked' : '' }>禁用
							</label>
						</div>
						<div class="radio-box">
							<label>
								<input name="status" type="radio" id="status1" value="1" ${requestScope.menu.status == '1' ? 'checked' : '' }>启用
							</label>
						</div>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">内容：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<textarea name="content" cols="" rows="" class="textarea"  placeholder="说点什么...最少输入10个字符" 
							datatype="*10-100" dragonfly="true" nullmsg="备注不能为空！" 
							onKeyUp="$.Huitextarealength(this,200)">${requestScope.menu.content}</textarea>
						<p class="textarea-numberbar"><em class="textarea-length">0</em>/200</p>
					</div>
				</div>
				<div class="row cl">
					<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
						<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
					</div>
				</div>
			</form>
		</article>
		<%@ include file="/common/include/footer.jsp"%>
		<!--请在下方写此页面业务相关的脚本-->
		<script type="text/javascript" src="${rootPath }/common/resource/H-ui.admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
		<script type="text/javascript" src="${rootPath }/common/resource/H-ui.admin/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
		<script type="text/javascript" src="${rootPath }/common/resource/H-ui.admin/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
		<script type="text/javascript" src="${rootPath }/common/resource/H-ui.admin/lib/jquery.validation/1.14.0/messages_zh.js"></script>
		<script type="text/javascript" src="${rootPath }/common/resource/H-ui.admin/lib/webuploader/0.1.5/webuploader.min.js"></script> 
		<script type="text/javascript" src="${rootPath }/common/resource/H-ui.admin/lib/ueditor/1.4.3/ueditor.config.js"></script> 
		<script type="text/javascript" src="${rootPath }/common/resource/H-ui.admin/lib/ueditor/1.4.3/ueditor.all.min.js"> </script> 
		<script type="text/javascript" src="${rootPath }/common/resource/H-ui.admin/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
		<script type="text/javascript">
		$(function(){
			$('.skin-minimal input').iCheck({
				checkboxClass: 'icheckbox-blue',
				radioClass: 'iradio-blue',
				increaseArea: '20%'
			});
			
			//表单验证
			$("#form-article-add").validate({
				rules:{
					name:{
						required:true,
						minlength:4,
						maxlength:50
					},
					content:{
						required:true,
					}
				},
				onkeyup:false,
				focusCleanup:true,
				success:"valid",
				submitHandler:function(form){
					$(form).ajaxSubmit({
						type: 'post',
						success: function(data){
							console.log("==data==",data)
							data = JSON.parse(data);
							layer.msg(data.info,{icon:1,time:3000},function(){
								/* 关闭当前窗口 */
								if (data.code == '0') {
									var index = parent.layer.getFrameIndex(window.name);
									parent.$('.btn-refresh').click();
									parent.layer.close(index);
									console.info("=====")
								}
							});
						},
		                error: function(XmlHttpRequest, textStatus, errorThrown){
							layer.msg('error!',{icon:1,time:1000});
						}
					});
				}
			});
		});
		</script>
		<!--/请在上方写此页面业务相关的脚本-->
	</body>
</html>